#include "editorwidget.hh"

EditorWidget::EditorWidget(QWidget *parent) :
    QTextEdit(parent)
{
    m_syntaxHighlighter = new SyntaxHighlighter(document());
}


void EditorWidget::keyPressEvent(QKeyEvent* event)
{
    if(event->key() == Qt::Key_Tab)
    {
        this->insertPlainText("    ");
        event->accept();
        return;
    }
    QTextEdit::keyPressEvent(event);
}

int EditorWidget::line(void)
{
    return textCursor().blockNumber() + 1;
}

int EditorWidget::column(void)
{
    return textCursor().columnNumber() + 1;
}
